{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "82f0792c",
   "metadata": {},
   "source": [
    "# 题目一\n",
    "有一个这样的DNA核酸序列\n",
    "\n",
    "“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”\n",
    "\n",
    "请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "acf452ea",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "此DNA核酸序列中有20个A, 17个G, 12个C, 21个T\n"
     ]
    }
   ],
   "source": [
    "dna_list = list('AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC')\n",
    "count_a = dna_list.count('A')\n",
    "count_g = dna_list.count('G')\n",
    "count_c = dna_list.count('C')\n",
    "count_t = dna_list.count('T')\n",
    "print(\"此DNA核酸序列中有%d个A, %d个G, %d个C, %d个T\"%(count_a,count_g,count_c,count_t))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "34ada2bd",
   "metadata": {},
   "source": [
    "# 题目二\n",
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "4df27377",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "一个运动员可能得0.50分\n",
      "一个运动员可能得0.75分\n",
      "一个运动员可能得1.00分\n",
      "一个运动员可能得1.25分\n",
      "一个运动员可能得1.50分\n",
      "一个运动员可能得1.75分\n",
      "一个运动员可能得2.00分\n",
      "一个运动员可能得2.25分\n",
      "一个运动员可能得2.50分\n",
      "一个运动员可能得2.75分\n",
      "一个运动员可能得3.00分\n",
      "一个运动员可能得3.25分\n",
      "一个运动员可能得3.50分\n",
      "一个运动员可能得3.75分\n",
      "一个运动员可能得4.00分\n",
      "一个运动员可能得4.25分\n",
      "一个运动员可能得4.50分\n",
      "一个运动员可能得4.75分\n",
      "一个运动员可能得5.00分\n",
      "一个运动员可能得5.25分\n",
      "一个运动员可能得5.50分\n",
      "一个运动员可能得5.75分\n",
      "一个运动员可能得6.00分\n",
      "一个运动员可能得6.25分\n",
      "一个运动员可能得6.50分\n",
      "一个运动员可能得6.75分\n",
      "一个运动员可能得7.00分\n",
      "一个运动员可能得7.25分\n",
      "一个运动员可能得7.50分\n",
      "一个运动员可能得7.75分\n",
      "一个运动员可能得8.00分\n",
      "一个运动员可能得8.25分\n",
      "一个运动员可能得8.50分\n",
      "一个运动员可能得8.75分\n",
      "一个运动员可能得9.00分\n",
      "一个运动员可能得9.25分\n",
      "一个运动员可能得9.50分\n",
      "一个运动员可能得9.75分\n",
      "一个运动员可能得10.00分\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "score = tuple(np.arange(0.25,10.25,0.25))\n",
    "for i in range(len(score)):\n",
    "    print(\"一个运动员可能得%.2f分\"%score[i])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df88a6cd",
   "metadata": {},
   "source": [
    "# 题目三\n",
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些。 最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "8fef1067",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肠粉是广州的一种美食，它的主要原料是米\n",
      "锅包肉是沈阳的一种美食，它的主要原料是猪肉\n",
      "biangbiang面是西安的一种美食，它的主要原料是米粉\n"
     ]
    }
   ],
   "source": [
    "food = {}\n",
    "food['肠粉'] = {'城市':'广州','原料':'米'}\n",
    "food['锅包肉'] = {'城市':'沈阳','原料':'猪肉'}\n",
    "food['biangbiang面'] = {'城市':'西安','原料':'米粉'}\n",
    "for food,meaning in food.items():\n",
    "    city = meaning['城市']\n",
    "    material = meaning['原料']\n",
    "    print(\"%s是%s的一种美食，它的主要原料是%s\"%(food,city,material))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
